package cn.edu.dgut.css.sai.course.wechatoauth2demo.config;

import lombok.Data;
import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor;

/**
 * 微信测试号appID与appSecret
 *
 * @author sai
 * @see OAuth2ClientProperties
 * @see ConfigurationPropertiesBindingPostProcessor
 * @since 2020/12/26
 */
@ConfigurationProperties(prefix = "sai.wechat.oauth2.client")
@Data
public class WeChatOAuth2ClientProperties {

    /**
     * 测试号 appID
     */
    private String appId;

    /**
     * 测试号 appSecret
     */
    private String appSecret;

    /**
     * snsapi_base 和 snsapi_userinfo
     */
    private String scope = "snsapi_base";

    /**
     * 获取 access_token API
     */
    private String accessTokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";

    /**
     * 拉取用户信息API，但网页授权作用域必需为 snsapi_userinfo
     */
    private String userInfoUrl = "https://api.weixin.qq.com/sns/userinfo";
}
